package cn.cimoc.service;

import cn.cimoc.model.dto.inut.UserLoginInput;
import cn.cimoc.model.dto.output.UserInfo;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * @author LGZ
 * @date 2021/11/11 14:04
 */
public interface UserService {
    /**
     * <p>
     *
     * @author lgz
     * @date 2021/11/21 20:54
     * @param response :
     */
    @Transactional(rollbackFor = Exception.class)
    void register(String username, String password, HttpServletResponse response);

    /**
     * 修改密码
     * @param op 旧密码
     * @param np 新密码
     * @param uid uid
     */
    void changePassword(String op, String np, Long uid);

    /**
     * 获取用户信息
     * @param uid uid
     * @return data
     */
    UserInfo getInfo(Long uid);

    /**
     * 修改个人信息
     * @param phone 电话
     * @param email 邮箱
     * @param gender 性别
     * @param uid uid
     */
    void changeInfo(String phone, String email, long gender, long uid);

    /**
     * 上传头像
     * @param img 头像
     * @param uid uid
     */
    String changeAvatar(MultipartFile img, long uid);

}
